package com.thrc.borrow.service;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.thrc.borrow.dao.RechargeDao;
import com.thrc.borrow.entity.Recharge;
import com.thrc.borrow.vo.RechargeVo;

@Service
public class RechargeService implements BaseService<Recharge, RechargeVo> {
	@Autowired
	private RechargeDao rechargeDao;

	@Override
	public RechargeVo selectById(Recharge t) {
		return rechargeDao.selectById(t);
	}

	@Override
	public List<RechargeVo> selectAll(Recharge t) {
		return rechargeDao.selectAll(t);
	}

	@Override
	public int selectCount(Recharge t) {
		return rechargeDao.selectCount(t);
	}

	@Override
	public List<RechargeVo> selectByPage(Recharge t) {
		t.setStartRow(t.getPageIndex(), t.getPageSize());
		return rechargeDao.selectByPage(t);
	}

	@Override
	public void update(Recharge t) {
		rechargeDao.update(t);
	}

	@Override
	public void delete(Recharge t) {
		rechargeDao.delete(t);
	}

	@Override
	public void insert(Recharge t) {
		t.setCreateTime(new Date());
		rechargeDao.insert(t);
	}

}
